﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Web7.ExceptionHandling;

namespace Web7.Container.ExceptionPublishers
{
	public class MockExceptionPublisher : IExceptionPublisher
	{
		public void Publish(Exception ex)
		{
			OperationProcessLevel level = ex.GetLevel();

			string message = "异常消息未予以显示";
			string stackTrace = "异常的调用堆栈未予以显示";
			string formatNotice = "系统于{0}发生了异常：\r\n{1}\r\n\r\n错误堆栈跟踪信息：\r\n{2}";



			message = ex.Message;
			stackTrace = ex.StackTrace;


			string text = string.Format(formatNotice, DateTime.Now, message, stackTrace);

			Console.WriteLine(text);
			System.Diagnostics.Debug.WriteLine(text);
		}

		public void Initialize(System.Collections.Specialized.NameValueCollection parameters)
		{

		}
	}
}
